/**
 * 滚动到表单错误字段
 * @param error - 表单验证错误对象
 */
export const formScrollToError = (error: any) => {
    const errorField = error.errorFields?.[0];
    const errorElement = document.querySelector(`#${errorField?.name?.[0]}`);
    if (errorElement) {
        errorElement.scrollIntoView({ behavior: 'smooth', block: 'center' });
    }
}; 